﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public class BaseClass
    {
        public BaseClass()
        {
            MessageBox.Show("BaseClass - Constructor");
        }

        ~BaseClass()
        {
            MessageBox.Show("BaseClass - Destructor");
        }
    }

    public class ChildClass : BaseClass
    {
        public ChildClass()
        {
            MessageBox.Show("ChildClass - Constructor");
        }

        ~ChildClass()
        {
            MessageBox.Show("ChildClass - Destructor");
        }
    }

    public class DisposeClass : IDisposable
    {
        public DisposeClass()
        {
            MessageBox.Show("DisposeClass - Constructor");
        }

        ~DisposeClass()
        {
            MessageBox.Show("DisposeClass - Destructor");
        }

        #region IDisposable Members

        void IDisposable.Dispose()
        {
            MessageBox.Show("DisposeClass.Dispose()");
        }

        #endregion
    }
}
